package com.store.mapper;

import com.store.entity.Address;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 持久层（收获地址模块）
 **/
@Mapper
public interface AddressMapper {

    /**
     * 新增收获地址
     * @param address
     * @return
     */
    int addAddress(Address address);

    /**
     * 查询收获地址
     * @param aid 收获地址id
     * @param uid 用户id
     * @return
     */
    Address selectAddressByAid(Integer aid,Integer uid);

    /**
     * 查询收获地址列表
     * @param uid 用户id
     * @return
     */
    List<Address> selectAddressByUid(Integer uid);

    /**
     * 删除收货地址
     * @param aid 收货地址id
     * @return
     */
    int deleteAddress(Integer aid);
}
